package com.learn.wiki.controller;

import com.learn.wiki.domain.Demo;
import com.learn.wiki.service.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


//@Controller 返回页面
@RequestMapping("/demo")
@RestController  //返回字符串
public class DemoController {


    @Resource
    private DemoService demoService;



    @GetMapping("list")
    public List<Demo> list() {
        return demoService.list();
    }
}
